package com.hk.webapp.service.impl;

import com.hk.webapp.bean.SysUserRole;
import com.hk.webapp.dao.SysUserRoleMapper;
import com.hk.webapp.service.SysUserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(readOnly = true)
public class SysUserRoleServiceImpl implements SysUserRoleService {

    @Resource
    private SysUserRoleMapper sysUserRoleMapper;

    @Override
    public List<SysUserRole> getEntityListByUserId(Integer userId) {
        return sysUserRoleMapper.getEntityListByUserId(userId);
    }

    @Override
    public List<SysUserRole> getEntityListByUserIds(List<Integer> userId) {
        return sysUserRoleMapper.getEntityListByUserIds(userId);
    }

    @Override
    @Transactional
    public int deleteByUserIds(List<Integer> sysUserIds) {
        return sysUserRoleMapper.deleteByUserIds(sysUserIds);
    }

    @Override
    @Transactional
    public int insert(SysUserRole sysUserRole) {
        return sysUserRoleMapper.insert(sysUserRole);
    }
}
